package com.aptemo.webetek.client.commands.responses;

import java.util.ArrayList;

import com.aptemo.webetek.shared.LabelBean;
import com.google.gwt.user.client.rpc.AsyncCallback;

public abstract class GotLabelsList implements AsyncCallback<ListResponse<LabelBean>>
{

	@Override
	public void onFailure(Throwable caught)
	{
		onError(caught.getLocalizedMessage());
	}

	@Override
	public void onSuccess(ListResponse<LabelBean> result)
	{
		if (result == null)
			onError("");
		else
			got(result.getList());
	}

	public abstract void got(ArrayList<LabelBean> result);

	public abstract void onError(String message);

}
